# main.py

import os, sys
os.environ["DJANGO_SETTINGS_MODULE"] = "nextodo.settings"
sys.path.append(".")

#GAE imports
from google.appengine.ext.webapp import util

#force django to reload its settings
from django.conf import settings
settings._target=None

import django.core.handlers.wsgi
import django.core.signals
import django.db
import django.dispatch.dispatcher

#log errors
#
#

#unregister the rollback event handler
django.dispatch.dispatcher.disconnect(
        django.db._rollback_on_exception,
        django.core.signals.got_request_exception)

def main():
    # Create a django application for WSGI
    application = django.core.handlers.wsgi.WSGIHandler()

    # run the WSGI CGI handler with that application
    util.run_wsgi_app(application)

if __name__ == "__main__":
    main()


